﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Acoris.Document
{
    /// <summary>
    /// 请求资源事件参数
    /// </summary>
    public sealed class RequireResourceEventArgs : EventArgs
    {
        readonly AcorisMarkdownResource _resource;
        readonly ResourceType _type;
        readonly object _param;

        /// <summary>
        /// 初始化请求资源事件参数
        /// </summary>
        /// <param name="resource">请求的资源</param>
        /// <param name="param">请求资源的额外参数</param>
        public RequireResourceEventArgs(AcorisMarkdownResource resource,object param) : base()
        {
            _resource = resource ?? throw new NullReferenceException();
            _param = param ?? throw new NullReferenceException();
            _type = _resource.Type;
        }

        /// <summary>
        /// 标识请求的资源
        /// </summary>
        public AcorisMarkdownResource Require {
            get {
                return _resource;
            }
        }

        /// <summary>
        /// 获取当前请求的资源类型
        /// </summary>
        public ResourceType Type {
            get {
                return _type;
            }
        }

        /// <summary>
        /// 获取额外的参数
        /// </summary>
        public object Parameter {
            get {
                return _param;
            }
        }

    }
}
